﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcmyjobs.Web.findjobs
{
    public partial class ListRewardJobs : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Application["webid"] != null)
                {
                    this.Title = string.Format("{1}求职中心-悬赏职位  {0}", Application["webname"].ToString(), Application["webregion"].ToString());
                    Bind(Convert.ToInt32(Application["webid"]));
                }
            }
        }

        private void BindIsFrist()
        {
            //this.News_jyzd.count = 6;
            //this.News_jyzd.typeid = 4;
            //this.News_jyzd.linkname = "更多职业规划";
            //this.News_jyzd.linkurl = "../findJobs/ShowNews.aspx?nid=-1&type_id=" + 4 ; 
            //this.News_jyzd.infourl = "../findJobs/ShowNews.aspx";
            //this.News_jyzd.para = "&type_id=" + 4;

            this.News_jyzd.count = 9;
            this.News_jyzd.typeid = 4;
            this.News_jyzd.linkname = "更多职业规划>>";
            this.News_jyzd.linkurl = "../article-ntid-" + 4 + ".html";
            this.News_jyzd.infourl = "../article";
            this.News_jyzd.para = "-" + 4;
            

        }


        private void Bind(int atid)
        {
            //int count = 0;
            //DataSet ds = new lcmyjobs.BLL.enterprise_releasejob().GetJobsInfoByCondition("reward", atid, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, out count);

            //this.gv_rewardJobs.DataSource = ds;
            //this.gv_rewardJobs.DataBind();

            int c_isfrist = 0;
            int c_reward = 0;
            int c_vip = 0;
            int c_hunter = 0;
            int c_newjob = 0;
            int c_workerclass = 0;


            DataSet ds = new lcmyjobs.BLL.enterprise_releasejob().GetJobsInfo(false, true, false, false, false, false,
                                                atid, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize,
                                                out c_isfrist, out c_reward, out c_hunter, out c_vip, out c_newjob, out c_workerclass);

            this.gv_rewardJobs.DataSource = ds;
            this.gv_rewardJobs.DataBind();

            this.AspNetPager1.RecordCount = c_reward;


            BindIsFrist();
        }
        public string GetBH(string str)
        {
            return str.ToString().PadLeft(6, '0');
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            if (Application["webid"] != null)
            {
                Bind(Convert.ToInt32(Application["webid"]));
            }
        }
    }
}